//
//  ChatMessage.m
//  LTChat
//
//  Created by apple on 4/21/14.
//  Copyright (c) 2014 fantasy. All rights reserved.
//

#import "ChatMessage.h"
#import "XMPPMessage.h"

@implementation ChatMessage
-(id)initWithElement:(XMPPMessage *)message
{
    self = [super init];
    if (self) {
        self.from = [[message from] user];
        self.to = [[message to] user];
        self.type = message.type;
        self.body = message.body;
        self.createDt = [[message attributeForName:@"createDt"].stringValue integerValue] / 1000.0;
        NSLog(@"%@,%@,%@,%lf",self.from,self.to,self.type,self.createDt);
    }
    return self;
}
@end
